package br.com.iswe.recipemaster.entities.security;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;

import br.com.iswe.core.entidades.annotation.GeradorConfig;
import br.com.iswe.core.entidades.annotation.SecurityStrategyType;
import br.com.iswe.recipemaster.entities.BaseEntity;

import com.google.appengine.api.datastore.Key;
import com.google.appengine.api.datastore.KeyFactory;

/**
 * @author Rafael Noronha
 * 
 * Entidade que define um Tipo de Role no sistema.
 * 
 * Possible values:
 * 
 * 1 - Business Object Method
 * 2 - Screen - Menu Entry
 * 3 - Screen Component - Button, Screen portion (panel) etc
 * 4 - System Internal Role
 * 
 */
@Entity
@GeradorConfig(securityStrategy = SecurityStrategyType.ACEGI_ISWE_INTEGRATION)
public class RoleType extends BaseEntity {

	private static final long serialVersionUID = 343564342441876231L;
	
	public static final Key ROLE_TYPE_SYSTEM_INTERNAL 	= KeyFactory.createKey(RoleType.class.getSimpleName(), "SYSTEM_INTERNAL");
	public static final Key ROLE_TYPE_BO_METHOD 		= KeyFactory.createKey(RoleType.class.getSimpleName(), "BO_METHOD");
	public static final Key ROLE_TYPE_SCREEN 			= KeyFactory.createKey(RoleType.class.getSimpleName(), "SCREEN");
	public static final Key ROLE_TYPE_SCREEN_COMP 		= KeyFactory.createKey(RoleType.class.getSimpleName(), "SCREEN_COMPONENT");
	
	private Key roleTypeId;
	private String description; 

	@Id
	public Key getRoleTypeId() {
		return roleTypeId;
	}
	public void setRoleTypeId(Key roleTypeId) {
		this.roleTypeId = roleTypeId;
	}
	
	@Column(nullable=false, length = 150)
	@GeradorConfig(campoDescricao=true)
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
}
